package com.ie.controller;

import com.ie.service.PetApplicationService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import com.ie.common.http.Result;

@RestController
@RequestMapping("/system/adminsPet")
public class PetApplicationController {
    @Resource
    private PetApplicationService petApplicationService;
    // 获取所有申请
    @RequestMapping("/all")
    public Result getAllPetApplication(){
        return petApplicationService.getAllPetApplication();
    }
    //修改状态
    @PostMapping ("/update")
    public Result updatePetApplication( @RequestParam ("id") String id, @RequestParam ("status") String status){
        System.out.println(id+" "+status);
        if (petApplicationService.updatePetApplication(id,status)){
            return Result.build(null,1,"修改成功");
        }
        return Result.build(null,0,"修改失败");
    }

    @RequestMapping("/allz")
    public Result getAllPetApplicationz(){
        return petApplicationService.getAllPetApplicationz();
    }


}
